//
//  ZPBAllCollectionViewCell.m
//  WZLProduct
//
//  Created by boys on 16/3/26.
//  Copyright © 2016年 HaiTeng. All rights reserved.
//

#import "ZPBAllCollectionViewCell.h"

@interface ZPBAllCollectionViewCell ()

@property (nonatomic, retain) UILabel *nameLabel;

@end

@implementation ZPBAllCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
    }
    return self;
    
}
- (void)setModel:(ZPBChildModel *)model {
    
    _model = model;
    
    _nameLabel.text = model.tag;
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    
    
    self.nameLabel.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height);
//    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.bottom.right.left.offset(0);
//    }];
    _nameLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
    _nameLabel.alpha = 0.5;
    _nameLabel.textAlignment = NSTextAlignmentCenter;
    _nameLabel.textColor = [UIColor blackColor];
    
}

@end
